package com.aistar.service.impl;

import com.aistar.mapper.HonorMapper;
import com.aistar.mapper.ProjectExperienceMapper;
import com.aistar.pojo.Honor;
import com.aistar.pojo.HonorExample;
import com.aistar.pojo.ProjectExperience;
import com.aistar.pojo.ProjectExperienceExample;
import com.aistar.service.HonorService;
import com.aistar.util.MyBatisUtil;
import com.aistar.util.ServerResponse;
import org.apache.ibatis.session.SqlSession;

import java.util.List;

public class HonorServiceImpl implements HonorService {
    @Override
    public ServerResponse getAllByResumeId(Integer resumeId) {

        SqlSession sqlSession = MyBatisUtil.getSqlSession();
       HonorMapper mapper =   sqlSession.getMapper(HonorMapper.class);
        HonorExample example = new HonorExample();

        example.createCriteria().andResumeIdEqualTo(resumeId).andStatusEqualTo(0);

        List<Honor> honorList =  mapper.selectByExample(example);
        if(honorList!=null && honorList.size() >0)
            return ServerResponse.getDataSuccess(honorList);
        return ServerResponse.getDataFailed("暂无证书");


    }

    @Override
    public ServerResponse save(Honor honor) {
        return null;
    }

    @Override
    public ServerResponse modifyStatus(Honor honor) {
        return null;
    }

    @Override
    public ServerResponse modify(Honor honor) {
        return null;
    }

    @Override
    public ServerResponse getById(Integer id) {
        return null;
    }

    @Override
    public ServerResponse getAll() {
        return null;
    }
}
